<template>
	<view class="common-content">
		<view class="common-content-box container mb-30">
			<view class="common-msg-show">
				<view class="common-msg-title">
					<image src="@/static/img/common/line.png" alt="" class="img"></image>
					<text>提现金额</text>
				</view>
				<view class="common-msg-row container">
					<view class="common-msg-row-items firstitem">
						<!-- <view class="label">在线咨询价格</view> -->
						<u-input v-model="price" placeholder="请输入提现金额" type="number" :custom-style="inputStyle" />
						<view class="val">
							全部提现
						</view>
					</view>
					<view class="common-msg-row-items">
						<view class="label"> 可提现金额￥500.00,最低提现金额为￥10.00</view>
					</view>
				</view>
				<view class="common-msg-title">
					<image src="@/static/img/common/line.png" alt="" class="img"></image>
					<text>选择提现地址</text>
					<!-- <text class="submit-text" @tap="toAdd" v-show="!disabled">+添加</text> -->
				</view>
				<u-radio-group shape="circle" size="34" width="100%" :wrap="true" v-model="value"
					activeColor="#F4333C">
					<view class="common-msg-row container">
						<view class="common-msg-row-items">
							<image src="@/static/img/common/wx.png" alt="" class="img"></image>
							<view class="label">微信（推荐)</view>
							<view class="val">
								<u-radio @change="radioChange" :disabled="false" name="wx"></u-radio>
							</view>
						</view>
						<view class="common-msg-row-items">
							<image src="@/static/img/common/zfb.png" alt="" class="img"></image>
							<view class="label">支付宝（推荐)</view>
							<view class="val">
								<u-radio @change="radioChange" :disabled="false" name="zfb"></u-radio>
							</view>
						</view>
					</view>
				</u-radio-group>
			</view>
		</view>
		<view class="container">
			<!-- 通栏 -->
			<u-button @click="cashd" :custom-style="buttonStyle" shape="circle" hover-class="none">
				确认提现
			</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				price: 0,
				// 提现方式
				value: 'wx',
				// button
				buttonStyle: {
					marginBottom: "30rpx",
					width: "100%",
					height: "90rpx",
					fontSize: "32rpx",
					color: "#fff",
					borderRadius: "45rpx",
					backgroundColor: "#F4333C",
				},
				inputStyle: {
					background: 'none',
					padding: '0 20rpx',
				},
			};
		},
		methods: {
			// 选中某个单选框时，由radio时触发
			radioChange(e) {
				console.log(e);
			},
			cashd() {
				this.price = this.price + "";
				let price = parseInt(this.price)
				console.log(price, '提现金额');
				if (price >= 10) {
					console.log('10以上');
					// if (res.code == 200) {
					//   uni.showToast({
					//     title: "提现成功!",
					//     duration: 2000,
					//     icon: "none",
					//   });
					//   setTimeout(() => {
					//     uni.navigateBack({
					//       delta: 1,
					//     });
					//   }, 1000);
					// }

				} else {
					uni.showToast({
						title: "请输入正确金额",
						duration: 2000,
						icon: "none",
					});
				}
			},
			handleAll() {
				this.price = this.walletNum;
			},
		}
	}
</script>

<style lang="scss" scoped>
	.common-content-box {
		padding-top: 30rpx;
	}


	.common-msg-show {
		margin-top: 30rpx;

		.common-msg-title {
			display: flex;
			align-items: center;
			margin-bottom: 20rpx;

			>.img {
				width: 5rpx;
				height: 28rpx;
			}

			>text {
				font-size: 30rpx;
				font-weight: bold;
				color: #333333;
				margin-left: 10rpx;
			}

			.submit-text {
				flex: 1;
				color: #F4333C;
				text-align: right;
			}
		}

		.common-msg-row {
			margin-bottom: 40rpx;
			background-color: #fff;
			width: 100%;
			.firstitem {
				border: none;
			}

			&-items {
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 110rpx;
				border-top: 1rpx #E3E3E3 solid;
				font-size: 30rpx;

				>.img {
					width: 50rpx;
					height: 50rpx;
					margin-right: 20rpx;
				}

				.label {
					margin-right: 35rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					flex: 1;
				}

				.val {
					display: flex;
					align-items: center;
					margin-left: 17rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #F4333C;

				}

			}
			&-items:first-child{
				border-top: none;
			}
		}
	}
	// 单选
	::v-deep .u-radio-group{
		width: 100%;
	}
</style>
